<%# The container tag
- available local variables
current_page:  a page object for the currently displayed page
total_pages:   total number of pages
per_page:      number of items to fetch per page
remote:        data-remote
paginator:     the paginator that renders the pagination tags inside -%>

<% if total_pages > 1 %>
  <nav aria-label="<%= t("views.pagination.pagination") %>">
    <ul class="flex flex-wrap items-center text-sm text-secondary gap-x-1" data-pages>
      <%= paginator.prev_page_tag unless current_page.first? %>

      <% paginator.each_page do |page| -%>
        <% if page.display_tag? -%>
          <%= paginator.page_tag page %>
        <% elsif !page.was_truncated? -%>
          <%= paginator.gap_tag %>
        <% end -%>
      <% end -%>

      <% unless current_page.out_of_range? %>
        <%= paginator.next_page_tag unless current_page.last? %>
      <% end %>
    </ul>
  </nav>
<% end %>
